home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / include / netdb.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-11  |  2.1 KB  |  77 lines

  1. /*
  2.  * DESQview/X Socket Library. Copyright (c) 1991 Quarterdeck Office Systems.
  3.  */
  4.  
  5. /*
  6.  * Copyright (c) 1983 Regents of the University of California.
  7.  * All rights reserved.  The Berkeley software License Agreement
  8.  * specifies the terms and conditions for redistribution.
  9.  */
  10.  
  11. /*      @(#)netdb.h    */
  12.  
  13. #ifndef __NETDB_H__
  14. #define __NETDB_H__
  15.  
  16. /*
  17.  * Structures returned by network data base library.  All addresses are
  18.  * supplied in host order, and returned in network order (suitable for
  19.  * use in system calls).
  20.  */
  21. struct    hostent {
  22.     char    *h_name;    /* official name of host */
  23.     char    **h_aliases;    /* alias list */
  24.     int    h_addrtype;    /* host address type */
  25.     int    h_length;    /* length of address */
  26.     char    **h_addr_list;    /* list of addresses from name server */
  27. #define    h_addr    h_addr_list[0]    /* address, for backward compatiblity */
  28. };
  29.  
  30. struct  servent {
  31.         char    *s_name;        /* primary name of service */
  32.         char    **s_aliases;    /* other names of service */
  33.         short   s_port;         /* port number to use */
  34.         char    *s_proto;       /* protocol service is offered on */
  35. };
  36.  
  37. struct  protoent {
  38.         char    *p_name;        /* primary name of protocol */
  39.         char    **p_aliases;    /* other names of protocol */
  40.         short   p_proto;        /* protocol number */
  41. };
  42.  
  43.  
  44. #ifndef NO_PROTO
  45.  
  46. /* hosts C functions */
  47.  
  48.   struct hostent *gethostbyname(char *);
  49.   struct hostent *gethostbyaddr(char *,int,int);
  50.  
  51. /* services C functions */
  52.  
  53.   struct servent *getservbyname(char *,char *);
  54.   struct servent *getservbyport(int,char *);
  55.   struct servent *getservent(void);
  56.   void setservent(int);
  57.   void endservent(void);
  58.  
  59. /* protocol C functions */
  60.  
  61.   struct protoent *getprotobyname(char *);
  62.   struct protoent *getprotobynumber(int);
  63.  
  64. #else /* NO_PROTO */
  65.  
  66.     struct hostent      *gethostbyname(), *gethostbyaddr();
  67.     struct servent      *getservbyname(), *getservbyport(), *getservent();
  68.     struct protoent     *getprotobyname(), *getprotobynumber();
  69.     setservent();
  70.     endservent();
  71.  
  72.  
  73. #endif /* NO_PROTO */
  74.  
  75. #endif /* __NETDB_H__ */
  76.  
  77.